//
//  ViewController.m
//  test
//
//  Created by 葛殿宏 on 2017/2/22.
//  Copyright © 2017年 arenacloud. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

    @property (strong, nonatomic) IBOutlet UIWebView *webview;
    @property (strong, nonatomic) IBOutlet UITextField *urlTextField;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    //http://cache.utovr.com/s1onrhwh6jfm0kalnb/L2_4rcjgvkc08pzu95u.mp4
    
    self.urlTextField.text = @"http://dongbo-ali-hls.arenacdn.com/vr/vr.html?src=http://dongbo-ali-hls.arenacdn.com/vr/vod/like2.mp4&clear=cache";
    self.urlTextField.text = @"http://172.16.48.69:8080/vr.html?src=http://172.16.48.69:8080/hls/room1.m3u8";
    self.urlTextField.text = @"http://172.16.48.69:8080/vr.html?src=hecheng-1400x720-1500k-mix.mp4";
    self.urlTextField.text = @"http://bfred-it.github.io/iphone-inline-video/demo/";
    NSString *url = self.urlTextField.text;
    
//    url = @"http://vshop-5-hls.arenacdn.com/dh5live.html?src=http://vshop-5-hls.arenacdn.com/prod/1gTlrQzy5TgTEEIS/index.m3u8&v=2&clear=cache";
    [self.webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
    
//    [self.webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://vshop-5-hls.arenacdn.com/dh5live.html?src=http://vshop-5-hls.arenacdn.com/prod/nano11.m3u8"]]];

//    [self.webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://vshop-5-hls.arenacdn.com/dh5live.html?src=http://vshop-5-hls.arenacdn.com/prod/nano11.m3u8"]]];
}

- (IBAction)loadButtonClick:(id)sender {
    [self.urlTextField resignFirstResponder];
    self.webview.mediaPlaybackRequiresUserAction = NO;
    [self.webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.urlTextField.text]]];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
